<?php
namespace catchAdmin\product\request;

use catchAdmin\product\model\Unit;
use catcher\base\CatchRequest;

class UnitCreateRequest extends CatchRequest
{

    protected function rules(): array
    {
        // TODO: Implement rules() method.
        return [
            'tenant_id' => 'require',
            'unit_name' => 'require|unique:db_unit,unit_name^tenant_id'
        ];
    }

    protected function message()
    {
        // TODO: Implement message() method.
        return [
            'unit_name.unique' => '已存在相同单位名',
            'unit_name.require'=>"单位名不能为空"
        ];
    }
}